package com.mongodb.orders.db;

import com.mongodb.orders.Order;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.data.mongodb.repository.Query;

import java.util.List;

public interface OrderRepository extends MongoRepository<Order,String>,OrderOperations {
    List<Order> findByCustomer(String c);
    List<Order> findByCustomerLike(String c);
    List<Order> findByCustomerAndType(String c,String t);
    List<Order> findByCustomerLikeAndType(String c,String t);
    @Query("{'customer':?0}")
    List<Order> findOrdersByCondition(String customer);
    Order findFirstByCustomer(String c);

}
